home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12533 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.1 KB  |  51 lines

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: FLOATING POINT PROBLEM
  5. Date: 1 Apr 1996 08:07 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <1APR199608073462@erich.triumf.ca>
  9. References: <4joeof$hoc@newsbf02.news.aol.com>
  10. NNTP-Posting-Host: ftp.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <4joeof$hoc@newsbf02.news.aol.com>, maddawson@aol.com (MADDawson) writes...
  14. >I have been working on a Windows program.  The prog compiles correctly
  15. >without any warnings or errors.  When I add something that tries to get a
  16. >float value from a string, the program quits running.  It does this in and
  17. >out of the IDE.
  18.  
  19. While you did give a good description of the problem, and the steps you took to
  20. try to correct it, you omitted two very important details that would help
  21. others suggest solutions: the particular compiler you are using, and the error
  22. messages you get.
  23.  
  24. This is a fairly common problem with Borland compilers, and usually results in
  25. an error message like "scanf: floating point formats not linked"
  26.  
  27. In an effort to save a couple of K of code size, Borland compilers omit support
  28. for floating point operations if the linker doesn't see any float operations -
  29. just reading a float with scanf() is apparently not sufficient to make the
  30. linker include the float support.
  31.  
  32. This is probably covered in the readme files that come with the compiler - it
  33. is for my TC4.5Win.
  34.  
  35. The recommended cure is something like: 
  36.     Add the following lines to one source file:
  37.     extern _floatconvert
  38.     #pragma extref _floatconvert
  39. (strictly from memory....)
  40.  
  41. Or just add some real float operation.
  42.  
  43. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  44. Internet: bennett@triumf.ca         | of one another only when one can be
  45. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  46. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  47. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  48. or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
  49.  
  50.